﻿<%@ Control Language="C#" AutoEventWireup="true" CodeFile="NTS-SearchControl.ascx.cs" Inherits="Notes_UserControls_NTS_SearchControl" %>
<style>
.selectsize1 {
border: 0;
float: left;
color: #666;
width: 150px;
height: 30px;
padding: 6px 5px 0;
margin-left: 10px;
background: fff;
}
 .inputsize1 {
border: 0;
color: #666;
width: 150px;
height: 26px;
padding: 2px 5px;
margin-left: 10px;
}
</style>
   <div class="clear"></div>   
 <asp:UpdatePanel ID="dfd" runat="server" UpdateMode="Conditional"><ContentTemplate>
         
         <div class="search_s">
           <div class="search_s_middel">           
           			<div class="search_box bold ml15px">search for
                    <asp:TextBox ID="txtName" runat="server" CssClass="inputsize1"></asp:TextBox>
                    </div>
                    <div class="search_box"><span class="select_text"> in</span>
                    <asp:DropDownList ID="ddlStream" runat="server" CssClass="selectsize1" OnSelectedIndexChanged="ddlStream_SelectedIndexChanged" AutoPostBack="true"></asp:DropDownList>                                        
                      <div class="listbox_icon"></div>
                      </div>
                    <div class="search_box"><span class="select_text"> in</span>
                    <asp:DropDownList ID="ddlSubject" runat="server" CssClass="selectsize1"></asp:DropDownList>                        
                      <div class="listbox_icon"></div>
                      </div>
                    <div class="search_box"><span class="select_text"> in</span>
                    <asp:DropDownList ID="ddlDocType" runat="server" CssClass="selectsize1">
                       <asp:ListItem Text="Select" Value="0"></asp:ListItem>
                  <asp:ListItem Text="Notes" Value="1"></asp:ListItem>
                  <asp:ListItem Text="Question Papers" Value="2"></asp:ListItem></asp:DropDownList>                        
                      <div class="listbox_icon"></div>
                      </div>
                    <asp:ImageButton ID="btnSearch" runat="server" 
                        ImageUrl="/Notes/images/search_button.png" border="0" onclick="btnSearch_Click" />                  
            </div>
         </div>
         </ContentTemplate></asp:UpdatePanel>

         <script>
             var prm = Sys.WebForms.PageRequestManager.getInstance();
             prm.add_beginRequest(BeginRequestHandler);

             function BeginRequestHandler(sender, args) {
                 $(function () {
                     var id = args._postBackElement.id;
                     if (id == 'search_btnSearch') {
                         if ($.trim($('#search_txtName').val()) == '' && $('#search_ddlStream').val() == '0' && $('#search_ddlSubject').val() == null && $('#search_ddlDocType').val() == '0') {
                             alert('Please choose atleast one parameter for search');
                         }
                     }
                 });

             } 

</script>